//
//  NetworkTools.swift
//  我的微博
//
//  Created by 原 on 15/10/9.
//  Copyright © 2015年 原哥. All rights reserved.
//

import UIKit


class NetworkTools: AFHTTPSessionManager {

    // 单例  未理解
    static let sharedTools:NetworkTools = {
        let baseURL = NSURL(string: "https://api.weibo.com/")!
        let tools = NetworkTools(baseURL: baseURL)
        return tools
        
        }()
    // MARK:-OAuth授权
    private let clientId = "1523272418"
    private let appSecret = "2662bd38a3ed970743afcb5853bae2ab"
    private let redirectUri = "http://www.baidu.com"
    
    /// 返回oAuth授权地址
    func oauthUrl() -> NSURL {
    let urlString = "https://api.weibo.com/oauth2/authorize?client_id=\(clientId)&redirect_uri=\(redirectUri)"
    
    return NSURL(string: urlString)!
    
    
    }
    
    
    

}
/*
App Key：1523272418(client_id)
App Secret：2662bd38a3ed970743afcb5853bae2ab
授权回调页：http://www.baidu.com
取消授权回调页：http://www.baidu.com   (redirect_uri)
https://api.weibo.com/oauth2/authorize?client_id=1523272418&redirect_uri=http://www.baidu.com

*/